package com.xjoyt.pay.master.controllers;

import java.util.Map.Entry;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.xjoyt.pay.controllers.AbstractController;
import com.xjoyt.pay.dto.ExecuteResult;
import com.xjoyt.pay.master.interfaces.DistributorPreferenceContract;
import com.xjoyt.pay.master.po.DistributorPreference;
import com.xjoyt.pay.master.services.DistributorPreferenceService;

@RestController
@RequestMapping("distributorPreference")
public class DistributorPreferenceController extends AbstractController implements DistributorPreferenceContract {

	@Autowired
	private DistributorPreferenceService service;

	@Override
	public DistributorPreference get(@PathVariable("id") String id) {
		return service.get(id);
	}

	@Override
	public DistributorPreference getByNo(@PathVariable("no") String no) {
		return service.getByNo(no);
	}

	@Override
	public ExecuteResult<?> saveValue(@PathVariable("id") String id, @RequestBody Entry<String, String> param)
			throws Exception {
		return service.saveValue(id, param);
	}

}
